package org.thingsboard.server.controller.swagger;

import org.springframework.data.domain.PageRequest;
import org.springframework.data.jpa.domain.Specification;

import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @author 刘祝蓝
 * @Description
 * @date 2019/12/11 20:21
 */
public class Transfer {


    public static PageRequest getPageRequest(Map map){
            Map data= (Map)map.get("requestBody");
            return PageRequest.of(null!=data.get("pageNo")?Integer.valueOf(data.get("pageNo")+"")-1:0,null!=data.get("pageSize")?Integer.valueOf(data.get("pageSize")+""):10);
    }
}
